<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('lotteries', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->text('description')->nullable();
            $table->datetime('start_time');
            $table->datetime('end_time');
            $table->tinyInteger('status')->default(0); // 0:未开始 1:进行中 2:已结束
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('lotteries');
    }
}; 